1. Field of the Invention
The present invention relates to an image processing technique for detecting and extracting a document area from a read image.
2. Description of the Related Art
An algorithm for extracting a rectangular area from a read image (original image) read by a scanner or the like in a conventional image processing apparatus has been proposed, as described in the specification of Japanese Patent Laid-Open No. 10-224563 (Patent Document 1). Further, in the case of an document having thickness, such as a book, an area of black pixels is produced surrounding the document in the read image because the document cover cannot be closed completely. The specifications of Japanese Patent Laid-Open Nos. 11-341230 (Patent Document 2), 2003-60872 (Patent Document 3), 2003-134322 (Patent Document 4) and 2005-252490 (Patent Document 5) propose techniques for detecting a document area based upon the area of black pixels and replacing the area of black pixels outside the document area with white pixels in order to avoid the wasteful consumption of toner or ink.
However, these conventional techniques involve certain problems. For example, with the image processing apparatus described in Patent Document 1, two different document edge sensing means are used. Detection of document size is performed by adopting the larger of two document edge positions, which have been sensed by respective ones of the document edge sensing means, as the document edge. A problem which arises is the high likelihood that the document size sensed as a result will be too large. Further, with the image processing apparatus described in Patent Document 2, the fact that a document to be read is a thick document such as a book is specified in advance. In other words, it is required that the user be aware of whether the document cover is open or closed.
With the image processing apparatus described in Patent Documents 3 and 4, either a document cover sensor is provided or the open-state of a document cover is detected by a brightness value acquired by a mounted reading sensor. Based upon the result of detection, processing is changed over or scanning is performed without placement of a document on the contact glass. In other words, a special sensor such as a document cover sensor is required. The problem that arises is an increase in cost. Further, in a case where the apparatus is equipped with a CCD-type reading sensor, the characteristic of the sensor is such that the reading depth is large. Consequently, if there is illumination such as a fluorescent lamp above the apparatus with the document cover open, the image data will clearly include the shape of the illumination. In order to eliminate this influence, scanning must be performed in the absence of a document and a complicated operation is required.
Furthermore, with the image processing apparatus described in Patent Document 5, a document area is detected based upon the state of continuous black pixels and white pixels in a case where a document is copied to paper of a size larger than the document size with the document cover left open. In this case, if the document cover is not left fully open, the density of a black area produced surrounding the document will not be uniform. As a result, depending upon the particular case, continuous pixels of a stipulated density cannot be detected and black pixels outside the document area are printed line by line.